<include path="header" /> 
<div class="m-title">
    <ul>
      <li>知识查看</li>
      <li><a href="/knowledge/index">知识管理</a></li>
      <li><a href="/knowledge">我的主题</a></li> 
      <li></li>
    </ul>
</div>
    <div class="box"> 
    	<div class="top-desc">
          <ul class="topicview">
              <li><h6><?=$kg['subject']?></h6></li>
              <li class="knowledge-content"><?=$kg['message']?></li>
              <li>
                  <div id="tag-ul-editable">
                      标签：<span class="tags"><? foreach(explode(',', $kg['tags']) as $i){ ?><a title="<?=urlencode($i)?>" href="/tag/search?tag=<?=urlencode($i)?>"><?=$i?></a><? }?></span><a href="javascript:tag_edit();" class="edit">修改</a>
                  
                  </div>
              </li>
              <li>                
              <? if(count($items) > 0){ foreach($items as $item){ if($item['type'] == 0){ ?>
                  <div class="cnt">                    
                      <p><?=$item['data'] ?></p>
                      <p class='desc'>此段由： <?=$item['username']?> 于 <?=date('Y-m-d H:i:s', $item['mktime'])?>添加</p>
                  </div>     
                  <? }else if($item['type'] == 1){ ?>
                  <? $attch = unserialize($item['data']); ?>   
                          
                  <div class="attachment">                    	
                      <p><a href="download?attchid=<?=$item['knowledge_item_id']?>" target="ajaxtarget"><?=$attch['name']?></a>&nbsp;&nbsp;[附]</p>
                      <p class='desc'>由： <?=$item['username']?>于<?=date('Y-m-d H:i:s', $item['mktime'])?>  上传</p>                        
                  </div> 
                  <?  }}}else{ ?>   
                      目前还没有补充，赶快添加吧！
                  <? } ?>                
              </li>
          </ul>
          <form action="addknowledge" method="post" target="ajaxpost">
              <ul >
                  <input type="hidden" id="knowledge_id" name="knowledge_id" value="<?=$kg['knowledge_id']?>" />
                  <li>
                      <p>补充</p>
                      <textarea id="forum-message" name="forum-message" rows="8"></textarea>
                  </li>
                  <li>
                      <div id="file-uploader-demo1"></div>
                      <iframe frameborder="0" src="/knowledge/attachment?kid=<?=$kid?>" class="hidden"></iframe>
                      
                  </li>
                  <li><input type="submit" class="button" value="更新" /></li>
              </ul>
          </form>             
          <iframe name="ajaxpost" id="ajaxpost" frameborder="0" class="hidden" height="0" width="0"></iframe>
        </div>
    </div> 
<include path="footer" />